import request from '~/utils/request'
export default{
  // 2.查询指定id的讲师
  createOrder(courseId, token) {
    return request({
      url: `/api/trade/order/auth/createOrder/${courseId}`,
      method: 'POST',
      headers: { token }
    })
  },
  // 获取订单信息
  getById(orderId, token) {
    return request({
      url: `/api/trade/order/auth/get/${orderId}`,
      method: 'GET',
      headers: { token }
    })
  },
  // 查询课程是否购买
  isBuy(courseId, token) {
    return request({
      url: `/api/trade/order/auth/isBuy/${courseId}`,
      method: 'GET',
      headers: { token }
    })
  },
  // 4、获取wx支付二维码链接
  getCodeUrl(orderId, token) {
    return request({
      url: `/api/trade/wx/auth/getCodeUrl/${orderId}`,
      method: 'GET',
      headers: { token }
    })
  },
  // 5.查询订单支付状态
  getPayStatus(orderId, token) {
    return request({
      url: `/api/trade/order/auth/getPayStatus/${orderId}`,
      method: 'GET',
      headers: { token }
    })
  }

}
